home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1998 March / Macworld (1998-03) (Disk 1).dmg / Shareware World / Utilities / Text Processing / Alpha / Tcl / Completions / BibCompletions.tcl next >
Encoding:
Text File  |  1997-10-08  |  1.3 KB  |  46 lines  |  [TEXT/ALFA]

  1. ## -*-Tcl-*-
  2.  # ###################################################################
  3.  #  Vince's Additions - an extension package for Alpha
  4.  # 
  5.  #  FILE: "bibtex+.tcl"
  6.  #                                    created: 10/5/95 {12:55:13 am} 
  7.  #                                last update: 5/10/97 {10:00:12 pm} 
  8.  #  Author: Vince Darley
  9.  #  E-mail: <darley@fas.harvard.edu>
  10.  #    mail: Division of Applied Sciences, Harvard University
  11.  #          Oxford Street, Cambridge MA 02138, USA
  12.  #     www: <http://www.fas.harvard.edu/~darley/>
  13.  #  
  14.  # ###################################################################
  15.  ##
  16.  
  17. set completions(Bib) {completion::cmd Entry completion::word}
  18.  
  19. # ◊◊◊◊ Completions ◊◊◊◊ #
  20.  
  21. set Bibcmds " $entryNames "
  22.  
  23. ## 
  24.  # -------------------------------------------------------------------------
  25.  #     
  26.  # "Bib::Completion::Entry"    --
  27.  #    
  28.  #    If the current text    is '@XXX' where    'XXX' is the name of a bib-entry
  29.  #    type, then insert the correct template for that    type.
  30.  # -------------------------------------------------------------------------
  31.  ##
  32. proc Bib::Completion::Entry {{dummy ""}} {
  33.     global rqdFld
  34.     set lastword [completion::lastWord where]
  35.     if {[lookAt [incr where -1]] != "@"} {
  36.         return 0
  37.     }
  38.     if ![info exists rqdFld($lastword)] {
  39.         return 0
  40.     }
  41.     bibFormatSetup
  42.     deleteText $where [getPos]
  43.     goto $where
  44.     newEntry $lastword
  45. }
  46.